/*****************************************************************************
 *
 *                      HUSONG PROPRIETARY INFORMATION
 *
 *          The information contained herein is proprietary to HUSONG
 *           and shall not be reproduced or disclosed in whole or in part
 *                    or used for any design or manufacture
 *              without direct written authorization from HUSONG.
 *
 *            Copyright (c) 2015 by HUSONG.  All rights reserved.
 *
 *****************************************************************************/
package me.send.data.service.mapper;

import java.util.List;
import java.util.Map;

import me.send.data.service.pojo.City;
import me.send.data.service.pojo.CityBean;
import me.send.data.service.provider.CityProvider;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;

/**
 * @author maxmin
 *
 * @date 2015年9月25日 上午11:35:50
 */
public interface CityMapper {
	
	/**
	 * 获取所有城市列表
	 * @return
	 * @author maxmin
	 * @date 2015年10月8日下午3:48:21
	 */
	@Select(value = "SELECT * FROM opencity")
	public List<City> getCitiesList();
	
	/**
	 * 获取已开放城市列表
	 * @return
	 * @author maxmin
	 * @date 2015年10月8日下午3:48:08
	 */
	@Select(value = "SELECT * FROM opencity WHERE openstatus=1")
	public List<City> getOpenCitiesList();
	
	@Update("update opencity  set openstatus=#{status} where opencityid=#{opencityid}")
	public abstract void updateStatus(Map<String,Object> param);
	
	
	@SelectProvider(method = "list", type = CityProvider.class)	
    public abstract List<CityBean> list(Map<String,Object> param);
    @SelectProvider(method = "count", type = CityProvider.class)	
    public abstract Integer count(Map<String,Object> param);
}
